package com.weixing.mall.provider.api.service;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.provider.api.fallback.ActivityGoodsServiceFallback;
import com.weixing.mall.provider.api.model.vo.ActGoodsVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.ribbon.FeignRibbonClientAutoConfiguration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author wx
 * @Date 2020/1/9 15:16
 * @Version 1.0
 */
@FeignClient(value = "mall-provider-cms", configuration = FeignRibbonClientAutoConfiguration.class, fallback = ActivityGoodsServiceFallback.class)
public interface ActivityGoodsRpcService {
    @GetMapping("/api/activity/Goods/selectByActIdAndItemId")
    Result<ActGoodsVo> selectByActIdAndItemId(@RequestParam("itemId") Long itemId, @RequestParam("actId") Long actId);
    @GetMapping("/api/activity/Goods/selectByActIdAndGoodsId")
    Result<List<ActGoodsVo>> selectByActIdAndGoodsId(@RequestParam("goodsId") Long goodsId, @RequestParam("actId") Long actId);
    @PostMapping("/api/activity/Goods/divideStock")
    Result divideStock(@RequestParam("id") Long id, @RequestParam("cnt") Integer cnt);
    @GetMapping("/api/activity/Goods/selectByActTypeAndItemId")
    Result<ActGoodsVo> selectByActTypeAndItemId(@RequestParam("actType")Integer actType, @RequestParam("itemId")Long itemId);
}
